package com.cnd.scm.code.generator.provider;


import com.cnd.scm.code.generator.provider.SchemaProviderFactory;
import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class TemplateMethodForGetDataType implements TemplateMethodModel{
	
	@Autowired
	@Lazy
	private SchemaProviderFactory schemaProviderFactory;


	
	@Override
	public Object exec(List arg0) throws TemplateModelException {
		
		return schemaProviderFactory.createDbSchemaProvider().getDataType(arg0.get(0).toString());
	}

}
